From 36ba5243d48c10b2fa0717b26e8f3b2e0e26902b Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Tue, 16 Nov 2010 11:44:09 +0000 Subject: [PATCH] x86 hvm vpmu: Print error if VPMU cannot be init'ed on this CPU. Signed-off-by: Dietmar Hahn Signed-off-by: Keir Fraser --- xen/arch/x86/hvm/vpmu.c | 54 ++++++++++++++++++++--------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/xen/arch/x86/hvm/vpmu.c b/xen/arch/x86/hvm/vpmu.c index f1917601ec..5214529a4e 100644 --- a/xen/arch/x86/hvm/vpmu.c +++ b/xen/arch/x86/hvm/vpmu.c @@ -97,43 +97,43 @@ void vpmu_initialise(struct vcpu *v) switch ( vendor ) { - case X86_VENDOR_AMD: + case X86_VENDOR_AMD: + switch ( family ) { - switch ( family ) - { - case 0x10: - vpmu->arch_vpmu_ops = &amd_vpmu_ops; - break; - default: - printk("VMPU: Initialization failed. " - "AMD processor family %d has not " - "been supported\n", family); - return; - } + case 0x10: + vpmu->arch_vpmu_ops = &amd_vpmu_ops; + break; + default: + printk("VPMU: Initialization failed. " + "AMD processor family %d has not " + "been supported\n", family); + return; } break; - case X86_VENDOR_INTEL: + case X86_VENDOR_INTEL: + if ( family == 6 ) { - if ( family == 6 ) + switch ( cpu_model ) { - switch ( cpu_model ) - { - case 15: - case 23: - case 26: - case 29: - vpmu->arch_vpmu_ops = &core2_vpmu_ops; - break; - } + case 15: + case 23: + case 26: + case 29: + vpmu->arch_vpmu_ops = &core2_vpmu_ops; + break; } } + if ( vpmu->arch_vpmu_ops == NULL ) + printk("VPMU: Initialization failed. " + "Intel processor family %d model %d has not " + "been supported\n", family, cpu_model); break; - default: - printk("VMPU: Initialization failed. " - "Unknown CPU vendor %d\n", vendor); - return; + default: + printk("VPMU: Initialization failed. " + "Unknown CPU vendor %d\n", vendor); + break; } if ( vpmu->arch_vpmu_ops != NULL ) -- 2.30.2